home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 187_01 / hseconds.c < prev    next >
Text File  |  1985-12-28  |  1KB  |  43 lines

  1. /*@*******************************************************/
  2. /*@                                                      */
  3. /*@ hseconds - return the current time-of-day in         */
  4. /*@        hundredths of seconds since midnight.         */
  5. /*@                                                      */
  6. /*@   Usage:     hseconds();                             */
  7. /*@                                                      */
  8. /*@   Returns a long value representing the number       */
  9. /*@      of seconds since midnight (0 <= x <= 8,640,000) */
  10. /*@                                                      */
  11. /*@*******************************************************/
  12.  
  13.  
  14. int hour, min, sec, hund;
  15.  
  16. long hseconds()
  17. {
  18.     
  19. #asm
  20.     PUSH    AX
  21.     PUSH    CX
  22.     PUSH    DX
  23.     MOV        AX,2C00H
  24.     INT        21H
  25.     MOV        AH,00
  26.     MOV        AL,CH
  27.     MOV        WORD hour_,AX
  28.     MOV        AL,CL
  29.     MOV        WORD min_,AX
  30.     MOV        AL,DH
  31.     MOV        WORD sec_,AX
  32.     MOV        AL,DL
  33.     MOV        WORD hund_,AX
  34.     POP        DX
  35.     POP        CX
  36.     POP        AX
  37. #endasm
  38.  
  39.     return ((long)hour * 360000 + (long)min * 6000
  40.              + (long)sec * 100 + (long)hund);
  41.  
  42. }
  43.